<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 100px;
            height: 200px;
            background-color: palegoldenrod;
            position: absolute;
            left: 0;
            top: 0;
            animation: donghua 10s ease-in infinite alternate;
        }
        /* 第一种 */
        
        @keyframes run {
            from {
                left: 0;
            }
            to {
                left: 800px;
            }
        }
        /* 第二种 */
        
        @keyframes donghua {
            0% {
                top: 0;
                left: 0;
            }
            25% {
                top: 0;
                left: 600px;
            }
            50% {
                top: 300px;
                left: 600px;
            }
            75% {
                top: 300px;
                left: 0px;
            }
            100% {
                top: 0px;
                left: 0px;
            }
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>